

;WS: Rigol Resistance 4W Range settings were displayed in the 2W resistance mode not in the 4W mode.




#metadef

#remove #cmdSetup radio Rate AC_Voltage
#remove #cmdSetup radio Rate AC_Current


#metadef
#idString Rigol Technologies,DM3058,
#name Rigol DM3058
#handle DM3058

#replace #cmdSetup comboboxHot Range AC_Current
:write: MEAS:CURR:AC
:read: MEAS:CURR:AC:RANG?
:updatemodechange:
20mA 0
200mA 1
2A 2
10A 3

#replace #cmdSetup comboboxHot Range Capacitance
:write: MEAS:CAP
:read: MEAS:CAP:RANG?
:updatemodechange:
2nF 0
20nF 1
200nF 2
2uF 3
200uF 4
10000uF 5


#metadef
#idString Rigol Technologies,DM3058E,
#name Rigol DM3058E
#handle DM3058

#port com

#replace #cmdSetup comboboxHot Range AC_Current
:write: MEAS:CURR:AC
:read: MEAS:CURR:AC:RANG?
:updatemodechange:
20mA 0
200mA 1
2A 2
10A 3

#replace #cmdSetup comboboxHot Range Capacitance
:write: MEAS:CAP
:read: MEAS:CAP:RANG?
:updatemodechange:
2nF 0
20nF 1
200nF 2
2uF 3
200uF 4
10000uF 5


; ------------------------------------------------------------------------------------------------
#meta
#idString Rigol Technologies,DM3068,
#name Rigol DM3068
#handle DM3068
#port 5555
; Alternate port types: comnobaud or com, com lets the user define baudrate on the "Load devices" page


; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6) 
; Format: #value ColumnName Unit Format {Selector}
; Selector is only used when column layout varies with mode, this often require the use of #cmdMode
#value VoltageDC V D6 DC_Voltage,Diode
#value CurrentDC A si DC_Current
#value VoltageAC V D6 AC_Voltage
#value CurrentAC A si AC_Current
#value Resistance ohm si 2W_Resistance,4W_Resistance,Continuity
#value Capacitance F si Capacitance
#value Temperature C D4 Temperature
#value Frequency Hz si Frequency
#value Period s si Period

#notes Slow mode is about 4 seconds for each measurement, it is NOT recommended to use this setting. 
Initially it shows as slow mode, but that mode it much faster than a selected slow mode!
This driver is based on the DM3068 help file and DM3058 2015 programming guide, not all of the meter functions can be controlled from SCPI and some settings cannot be read back.

; How to poll for data, this is used for table and #values?
; a #askMode, #cmdMode and #prepareSample is used before this is string is used.
; Number of returned values must match number of columns defined with #value
; This is a single line command
#askValues func2:value1?
; Format of answer: f=float, u=remove trailing letters, x=skip, *=Zero upper case values if this value is 0
;#askValuesReadFormat 

; Accept this delay when reading values (seconds)
#readingDelay 10

; Mode change have a longer delay on reading values (seconds)
#modeChangeDelay 10


; String to ask about actual meter mode, it is mostly used for DMM's
; This is a single line command
#askMode func?


; When one of these commands are used through the command interface a new configuration will be done before using #askMode
; Only one word for each #mayModifyMode
; Specify command without initial colon and in the shortest possible form
;#mayModifyMode 

; Prepare the meter to response to #askValues
;#prepareSample 

; Initial commands to meter when establishing connection, used to disable local control
#initCmd CMDSET Rigol;func2:value1?

; Final command to meter before breaking connection, used to restore local control
#finalCmd 

; Used to turn output off for power supplies, generators and electronic loads
;#outputOff 

#interfaceType DMM BMM
#interface readValue 0

#cmdModeLayout 3 4

#cmdMode DC_Voltage DCV
FUNC:VOLT:DC;[*OPC]

#cmdMode AC_Voltage ACV
FUNC:VOLT:AC;[*OPC]

#cmdMode 2W_Resistance 2WR
FUNC:RES;[*OPC]

#cmdMode DC_Current DCI
FUNC:CURR:DC;[*OPC]

#cmdMode AC_Current ACI
FUNC:CURR:AC;[*OPC]

#cmdMode 4W_Resistance 4WR
FUNC:FRES;[*OPC]

#cmdMode Diode DIODE
FUNC:DIOD;[*OPC]

#cmdMode Continuity CONT
FUNC:CONT;[*OPC]

#cmdMode Capacitance CAP
FUNC:CAP;[*OPC]

#cmdMode Frequency FREQ
FUNC:FREQ;[*OPC]

#cmdMode Period PERI
FUNC:PER;[*OPC]


;Mode-------------------------------------------------------------------------------------------
#cmdSetup info Active_Mode
:read: FUNC?
:readmath: getElement("Diode;DC Voltage;AC Voltage;DC Current;AC Current;Capacitance;2W Resistance;4W Resistance;Frequency;Period;Continuity;Sensor",listIndex(value,"DIODE DCV ACV DCI ACI CAP 2WR 4WR FREQ PERI CONT SENSOR"," "),";")
:updatemodechange:


; ------------------------------------- Volt DC -----------------------------------------------------------


#cmdSetup buttons Range DC_Voltage
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range DC_Voltage
:write: MEAS:VOLT:DC
:read: MEAS:VOLT:DC:RANG?
:updatemodechange:
200mV 0
2V 1
20V 2
200V 3
1000V 4

#cmdSetup radio Input_Z DC_Voltage
:write: MEAS:VOLT:DC:IMPE
:read: MEAS:VOLT:DC:IMPE?
:string:
:updatemodechange:
10M 10M
High 10G


#cmdSetup radio Rate DC_Voltage
:read: :RATE:VOLT:DC?
:write: :RATE:VOLT:DC
:string:
Slow SLOW
Medium MEDIUM
Fast FAST

; ------------------------------------- Volt AC -----------------------------------------------------------


#cmdSetup buttons Range AC_Voltage
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range AC_Voltage
:write: MEAS:VOLT:AC
:read: MEAS:VOLT:AC:RANG?
:updatemodechange:
200mV 0
2V 1
20V 2
200V 3
750V 4

#cmdSetup radio Rate AC_Voltage
:read: :RATE:VOLT:AC?
:write: :RATE:VOLT:AC
:string:
Slow SLOW
Medium MEDIUM
Fast FAST


; ------------------------------------- Current DC -----------------------------------------------------------


#cmdSetup buttons Range DC_Current
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range DC_Current
:write: MEAS:CURR:DC
:read: MEAS:CURR:DC:RANG?
:updatemodechange:
200uA 0
2mA 1
20mA 2
200mA 3
2A 4
10A 5



#cmdSetup radio Rate DC_Current
:read: :RATE:CURR:AC?
:write: :RATE:CURR:AC
:string:
Slow SLOW
Medium MEDIUM
Fast FAST


; ------------------------------------- Current AC -----------------------------------------------------------


#cmdSetup buttons Range AC_Current
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range AC_Current
:write: MEAS:CURR:AC
:read: MEAS:CURR:AC:RANG?
:updatemodechange:
200uA 0
2mA 1
20mA 2
200mA 3
2A 4
10A 5



#cmdSetup radio Rate AC_Current
:read: :RATE:CURR:AC?
:write: :RATE:CURR:AC
:string:
Slow SLOW
Medium MEDIUM
Fast FAST


; ------------------------------------- Resistance 2W -----------------------------------------------------------


#cmdSetup buttons Range Resistance_2W
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range Resistance_2W
:write: MEAS:RES
:read: MEAS:RES:RANG?
:updatemodechange:
200ohm 0
1kOhm 1
20kOhm 2
200kOhm 3
1Mohm 4
10Mohm 5
100Mohm 6

#cmdSetup radio Rate Resistance_2W
:read: :RATE:RES?
:write: :RATE:RES
:string:
Slow SLOW
Medium MEDIUM
Fast FAST


; ------------------------------------- Resistance 4W  -----------------------------------------------------------


#cmdSetup buttons Range Resistance_4W
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range Resistance_4W
:write: MEAS:FRES
:read: MEAS:FRES:RANG?
:updatemodechange:
200ohm 0
1kOhm 1
20kOhm 2
200kOhm 3
1Mohm 4
10Mohm 5
100Mohm 6


#cmdSetup radio Rate Resistance_4W
:read: :RATE:FRES?
:write: :RATE:FRES
:string:
Slow SLOW
Medium MEDIUM
Fast FAST


; ------------------------------------- Frequency  -----------------------------------------------------------

#cmdSetup buttons Range Frequency
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range Frequency
:write: MEAS:FREQ
:read: MEAS:FREQ:RANG?
:updatemodechange:
200mV 0
2V 1
20V 2
200V 3
750V 4

; ------------------------------------- Period  -----------------------------------------------------------

#cmdSetup buttons Range Period
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range Period
:write: MEAS:PER
:read: MEAS:PER:RANG?
:updatemodechange:
200mV 0
2V 1
20V 2
200V 3
750V 4


; ------------------------------------- Continuity  -----------------------------------------------------------

#cmdSetup NumberInt Max_Resistance Continuity
:write: :meas:cont
ohm 1 2000

; ------------------------------------- Capacitance  -----------------------------------------------------------

#cmdSetup buttons Range Capacitance
:write: MEAS #;[*OPC]
:updatedelayed: 0.5
Auto AUTO

#cmdSetup comboboxHot Range Capacitance
:write: MEAS:CAP
:read: MEAS:CAP:RANG?
:updatemodechange:
2nF 0
20nF 1
200nF 2
2uF 3
20uF 4
200uF 5
2mF 6
20mF 7
100mF 8


; ------------------------------------- Sensor  -----------------------------------------------------------

#cmdSetup info Mode_not_supported_on_SCPI Sensor


; ------------------------------------------------------------------------------------------------

#cmdSetup selector Mode_settings 
:read: FUNC?
:updatemodechange:
DCV DC_Voltage.
ACV AC_Voltage.
DCI DC_Current.
ACI AC_Current.
DIODE Diode.
FREQ Frequency.
2WR Resistance_2W.
4WR Resistance_4W.
CAP Capacitance.
CONT Continuity.
PERI Period.
SENSOR Sensor.


